<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="app">
				{{msg}}
				<br>
				<button @click="showInfo()"> 单击 </button>
				<br>
				单价 ： <input type="number" v-model="price" /> <br>
				数量 ： {{num}} <br>
				总价 ： {{totlaPrice}}
			   <button @click="num++"> 单击 </button>
		</div>
		<script>
			new Vue({
				el: "#app",
				data: {
					msg: "Vue实例创建成功",
					price: 100,
					num: 3
				},
				methods: {
					showInfo(){
						this.msg = "Hello Methods"
					}
				},
				computed: {
					totlaPrice() {
						return this.price * this.num;
					}
				}
			});
		</script>
	</body>
</html>
